<?php

use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\Facades\Log;

Broadcast::channel('private-channel.{userId}', function ($user, $userId) {
    Log::info('Sanctum User ID: ' . $user->id);
    Log::info('Channel User ID: ' . $userId);
    Log::info('Auth Result: ' . ((int) $user->id === (int) $userId));
    return (int) $user->id === (int) $userId;
});
